package com.nts.visionworks.business.endpoint.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.codehaus.jackson.annotate.JsonIgnore;

import com.nts.visionworks.core.validation.EntityIdNotNull;

/**
 * BuildingFloor generated by hbm2java
 */
@Entity
@Table(name = "building_floor", catalog = "visionworks")
public class BuildingFloor implements java.io.Serializable
{

	private Integer floorId;
	private Building building;
	private String floorNumber;
	private String floorArias;
	private Long floorPlanArchiveId;
	private String description;
	private Set<BuildingFloorArea> buildingFloorAreas = new HashSet<BuildingFloorArea>(
			0);
	private Set<BuildingFloorImage> buildingFloorImages = new HashSet<BuildingFloorImage>(
			0);

	public BuildingFloor()
	{
	}

	public BuildingFloor(Building building, String floorNumber)
	{
		this.building = building;
		this.floorNumber = floorNumber;
	}

	public BuildingFloor(Building building, String floorNumber,
			String floorArias, Long floorPlanArchiveId, String description,
			Set<BuildingFloorArea> buildingFloorAreas,
			Set<BuildingFloorImage> buildingFloorImages)
	{
		this.building = building;
		this.floorNumber = floorNumber;
		this.floorArias = floorArias;
		this.floorPlanArchiveId = floorPlanArchiveId;
		this.description = description;
		this.buildingFloorAreas = buildingFloorAreas;
		this.buildingFloorImages = buildingFloorImages;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "FloorId", unique = true, nullable = false)
	public Integer getFloorId()
	{
		return this.floorId;
	}

	public void setFloorId(Integer floorId)
	{
		this.floorId = floorId;
	}

	@EntityIdNotNull(message = "validation.endPoint.buidlingFloor.buidling.notNull")
	@JsonIgnore
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "BuildingId", nullable = false)
	public Building getBuilding()
	{
		return this.building;
	}

	public void setBuilding(Building building)
	{
		this.building = building;
	}

	@NotNull(message = "validation.endPoint.buidlingFloor.floorNumber.notNull")
	@Size(message = "validation.endPoint.buidlingFloor.floorNumber.length", max = 20, min = 1)
	@Column(name = "FloorNumber", nullable = false, length = 20)
	public String getFloorNumber()
	{
		return this.floorNumber;
	}

	public void setFloorNumber(String floorNumber)
	{
		this.floorNumber = floorNumber;
	}

	@Size(message = "validation.endPoint.buidlingFloor.floorArias.length", max = 100)
	@Column(name = "FloorArias", length = 100)
	public String getFloorArias()
	{
		return this.floorArias;
	}

	public void setFloorArias(String floorArias)
	{
		this.floorArias = floorArias;
	}

	@Column(name = "FloorPlanArchiveId")
	public Long getFloorPlanArchiveId()
	{
		return this.floorPlanArchiveId;
	}

	public void setFloorPlanArchiveId(Long floorPlanArchiveId)
	{
		this.floorPlanArchiveId = floorPlanArchiveId;
	}

	@Size(message = "validation.endPoint.buidlingFloor.description.length", max = 65535)
	@Column(name = "Description", length = 65535)
	public String getDescription()
	{
		return this.description;
	}

	public void setDescription(String description)
	{
		this.description = description;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "buildingFloor")
	@OrderBy("areaName")
	public Set<BuildingFloorArea> getBuildingFloorAreas()
	{
		return this.buildingFloorAreas;
	}

	public void setBuildingFloorAreas(Set<BuildingFloorArea> buildingFloorAreas)
	{
		this.buildingFloorAreas = buildingFloorAreas;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "buildingFloor")
	@OrderBy("displayOrder")
	public Set<BuildingFloorImage> getBuildingFloorImages()
	{
		return this.buildingFloorImages;
	}

	public void setBuildingFloorImages(
			Set<BuildingFloorImage> buildingFloorImages)
	{
		this.buildingFloorImages = buildingFloorImages;
	}

}
